from time import sleep
from selenium import webdriver
# 打开浏览器-创建浏览器对象
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
# 打开浏览器
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
driver = webdriver.Chrome(executable_path='chromedriver.exe')
# 放大浏览器
driver.maximize_window()
# # 设置隐式等待
driver.implicitly_wait(10)
# 输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
# driver = webdriver.Chrome()
# 显式等待
wait = WebDriverWait(driver, 10, 1)
username = wait.until(lambda x: x.find_element_by_css_selector("#userA"))
username.send_keys("admin")
sleep(3)
driver.close()